<div id="viewer-container"></div>
<script>
  CTS.ready(() => {
    let gui = new dat.GUI()
    let viewer = new CTS.Viewer('viewer-container') //初始化场景
    let params = {color: [3, 3, 3]}
    const folder = gui.addFolder('背景颜色')
    folder.addColor(params, 'color').name('场景背景').onChange(function () {
      let color = `rgb(${params.color[0].toFixed(0)},${params.color[1].toFixed(0)},${params.color[2].toFixed(0)})`
      // 这句话设置颜色
      viewer.setBackground(color)
    });
    folder.open()
  })
</script>
